<?php


namespace app\api\validate\user;


use think\Validate;

class User extends Validate
{
    protected $rule = [
        'username'  =>  'require',
        'id_card' =>  'require',
        'mobile' =>  '/^1\d{10}$/',
        'password' =>  ['regex'=>'/^(?![0-9]+$)(?![a-zA-Z]+$).{7,32}/'],
        'password_confirm' =>  'confirm:password',
        'pay_password' =>  '/^[0-9]{6}/',
        'pay_password_confirm' =>  'confirm:pay_password',
    ];
    protected $message = [
        'username.require'  =>  '用户名不能为空',
        'id_card' =>  '身份证号不能为空',
        'mobile' =>  '手机号码格式不正确',
        'password' =>  '密码须同时包含数字和字母,长度7~32位',
        'password_confirm' =>  '确认密码不一致',
        'pay_password' =>  '支付密码格式不正确，请输入6位整数',
        'pay_password_confirm' =>  '支付密码不一致',
    ];


}